Imports WinXound_Net.gVar


Public Class wxCompiler


    Public Sub New()
        ''DO NOTHING
    End Sub


    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''WINSOUND COMPILER
    Public Sub WinsoundCompiler(ByVal FileName As String)

        'Check for another running CSoundAV executable
        For Each p As Process In Process.GetProcesses
            If Strings.LCase(p.ProcessName) = "csound5gui" Then
                MessageBox.Show("It seems that there is another running instance of CSound5GUI" & vbCrLf & _
                                "Please close it before to run CSound5GUI compiler", "WinXound Info", _
                                MessageBoxButtons.OK, MessageBoxIcon.Information)
                Exit Sub
            End If
        Next


        Dim mtProc As New Process
        mtProc.StartInfo.FileName = Preferences.Directory.Winsound
        mtProc.StartInfo.Arguments = """" & FileName & """"
        'Proc.StartInfo.UseShellExecute = False
        'Proc.StartInfo.RedirectStandardOutput = True
        'Proc.StartInfo.CreateNoWindow = True
        'Proc.EnableRaisingEvents = True
        mtProc.Start()

    End Sub




    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''CSOUNDAV COMPILER
    Public Sub CSoundAVCompiler(ByVal FileName As String)

        'Check for another running CSoundAV executable
        For Each p As Process In Process.GetProcesses
            If Strings.LCase(p.ProcessName) = "csoundav_win" Then
                MessageBox.Show("It seems that there is another running instance of CSoundAV" & vbCrLf & _
                                "Please close it before to run CSoundAV compiler", "WinXound Info", _
                                MessageBoxButtons.OK, MessageBoxIcon.Information)
                Exit Sub
            End If
        Next


        Dim mtProc As New Process
        mtProc.StartInfo.FileName = Preferences.Directory.CSoundAV
        mtProc.StartInfo.Arguments = """" & FileName & """"
        'Proc.StartInfo.UseShellExecute = False
        'Proc.StartInfo.RedirectStandardOutput = True
        'Proc.StartInfo.CreateNoWindow = True
        'Proc.EnableRaisingEvents = True
        mtProc.Start()

    End Sub


End Class
